<template>
  <div class="newcontentmain">
    <ItemPanelHeader :item="items[0]">
      <div slot="itemPanelHeaderMenu">
        <!-- <slot name="customItemPanelHeaderMenu"></slot> -->
        <FollowButton :item="items[0]" :type="followType"></FollowButton>
      </div>
    </ItemPanelHeader>
    <ItemPanelContent
      :item="items[0]"
      :itemIndex="itemIndex"
      :showTools="showTools"
    >
      <div slot="customTools" slot-scope="{ item }">
        <BottomCommentInput :items="$store.state.user" :bottomType="bottomType">
          <input
            v-model="message"
            class="morecommentsmain_input"
            slot="input"
            :placeholder="
              $t('lang.以某某身份发布评论', {
                user: items.nickName || $t('lang.未知用户'),
              })
            "
          />
          <a
            href="javascript:;"
            class="morecommentsmain_send"
            @click="commentSendClickHandle"
            slot="handle"
            >{{ $t("lang.发布") }}</a
          >
        </BottomCommentInput>
      </div>
    </ItemPanelContent>
  </div>
</template>
<script>
export default {
  name: "NewContentMain",
  data() {
    return {
      items: [],
      itemIndex: 0,
      showTools: true,
      message: "",
      bottomType: 2,
      followType: 2,
    };
  },
  components: {
    ItemPanelHeader: () =>
      import(
        /* webpackChunkName: "itemPanelHeader" */ "../../components/common/itemPanel/itemPanelHeader"
      ),
    ItemPanelContent: () =>
      import(
        /* webpackChunkName: "itemPanelContent" */ "../../components/common/itemPanel/itemPanelContent.vue"
      ),
    BottomCommentInput: () =>
      import(
        /* webpackChunkName:"buttomCommentInput" */ "../../components/common/bottomCommentInput"
      ),
    FollowButton: () =>
      import(
        /* webpackChunkName:'followButton' */ "../../components/common/followButton.vue"
      ),
  },
  created() {
    this.items = [
      {
        id: "0123456",
        userId: "0123456",
        userHead:
          "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1595233833221&di=8cf8621bb5bdae4844362dfe99c54191&imgtype=0&src=http%3A%2F%2Fb.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fbd315c6034a85edf8c1758e240540923dc547553.jpg",
        nickName: "undefined",
        position: "中国",
        isNewContent: true,
        isFollow: true,
        contentId: "0123456",
        content: [
          {
            type: "image",
            url:
              "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=18296136,276139235&fm=26&gp=0.jpg",
          },
        ],
        tags: ["早晨", "asdfasdf", "电影", "娱乐自己", "标签测试", "线上测试"],
        isGood: true,
        goodCount: 2314,
        isCollection: true,
        comments: {
          list: [
            {
              userid: "0123456",
              nickName: "test",
              content: "comment content.",
            },
            {
              userid: "0123456",
              nickName: "adfasdfasd",
              content: "comment content. adfasdfasdfas",
            },
          ],
          count: 3312,
        },
        lastTime: 1595245074825,
      },
    ];
  },
  mounted() {
    window.scrollTo(1, 1);
  },
  methods: {
    commentSendClickHandle() {},
  },
};
</script>
<style lang="less">
@base: 23.44rem;
.newcontentmain {
  text-align: left;
}
</style>
